package app.r_teenus.backend.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "SERVICE_TYPE")
public class ServiceType implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7536300863769033778L;
	private Integer id = null;
	private ServiceUnitType serviceUnitType = null;
	private String name = null;
	private Double price = null;

	/**
	 * Gets id (primary key).
	 */
	@Id
	@Column(name = "SERVICE_TYPE")
	@SequenceGenerator(name = "service_type_id", sequenceName = "service_type_id", allocationSize = 1)
	@GeneratedValue(generator = "service_type_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	@OneToOne
	@JoinColumn(name = "SERVICE_UNIT_TYPE_FK", nullable = false)
	public ServiceUnitType getServiceUnitType() {
		return serviceUnitType;
	}

	public void setServiceUnitType(ServiceUnitType serviceUnitType) {
		this.serviceUnitType = serviceUnitType;
	}
	@Column(name = "TYPE_NAME")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "service_price")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

}
